package database

import (
	"log"

	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

var DBconnect *gorm.DB

var err error

func DD() {
	// https://github.com/go-sql-driver/mysql
	dsn := "root:xingji123@tcp(192.168.110.200:3306)/demo_database?charset=utf8&parseTime=True&loc=Local"

	DBconnect, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})

	if err != nil {
		log.Fatal(err)
	}
	if DBconnect == nil {
		log.Fatal(DBconnect)
	}

}
